<?php

/**
 * BolaoNews form base class.
 *
 * @method BolaoNews getObject() Returns the current form's model object
 *
 * @package    bolao-aabb
 * @subpackage form
 * @author     Your name here
 */
abstract class BaseBolaoNewsForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'             => new sfWidgetFormInputHidden(),
      'creator_id'     => new sfWidgetFormPropelChoice(array('model' => 'sfGuardUserProfile', 'add_empty' => false)),
      'summary'        => new sfWidgetFormInputText(),
      'description'    => new sfWidgetFormInputText(),
      'category_id'    => new sfWidgetFormPropelChoice(array('model' => 'BolaoCategory', 'add_empty' => false)),
      'subcategory_id' => new sfWidgetFormPropelChoice(array('model' => 'BolaoSubcategory', 'add_empty' => true)),
      'created_at'     => new sfWidgetFormDateTime(),
    ));

    $this->setValidators(array(
      'id'             => new sfValidatorPropelChoice(array('model' => 'BolaoNews', 'column' => 'id', 'required' => false)),
      'creator_id'     => new sfValidatorPropelChoice(array('model' => 'sfGuardUserProfile', 'column' => 'id')),
      'summary'        => new sfValidatorString(array('max_length' => 50)),
      'description'    => new sfValidatorString(array('max_length' => 975)),
      'category_id'    => new sfValidatorPropelChoice(array('model' => 'BolaoCategory', 'column' => 'id')),
      'subcategory_id' => new sfValidatorPropelChoice(array('model' => 'BolaoSubcategory', 'column' => 'id', 'required' => false)),
      'created_at'     => new sfValidatorDateTime(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('bolao_news[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'BolaoNews';
  }


}
